<template>
	<view>
		<view class="tabs">
			<uni-nav-bar fixed="true" left-icon="left" border="none" title="排行榜" @clickLeft="back()"
				@clickRight="onClickRight()" background-color="transparent" color="#ffffff"></uni-nav-bar>
		</view>
		<view class="black_1">

			<view class="top">
				<view class="header header2">
					<image class="image uniui-image2" :src="list.length>1 ?'/static/economy/num2.png':''"></image>
					<image class="image1 uniui-image2" :class="list.length>1?'image3':''"
						:src="list.length>1 ? list[1].user.avatar:''"></image>
				</view>

				<view  class="header header1">
					<image class="image uniui-image2" :src="list.length>0 ?'/static/economy/num1.png':''"></image>
					<image class="image1 uniui-image2" :class="list.length>0?'image3':''"
						:src="list.length>0 ? list[0].user.avatar:''"></image>


				</view>

				<view  class="header header3" >
					<image class="image uniui-image2" :src="list.length>2 ?'/static/economy/num3.png':''"></image>
					<image class="image1 uniui-image2" :class="list.length>2?'image3':''"
						:src="list.length>2 ? list[2].user.avatar:''"></image>
				</view>


			</view>
			<view class="bottom">
				<view class="name name1">{{list.length >1?list[1].user.nickname:''}}
					<view class="text1">
						{{list.length >1?'贡献值：'+list[1].order_amount+'':''}}
					</view>
				</view>
				<view class="name name2">{{list.length >0?list[0].user.nickname:''}}

					<view class="text1">
						{{list.length >0?'贡献值：'+list[0].order_amount+'':''}}
					</view>

				</view>
				<view class="name name3">{{list.length >2?list[2].user.nickname:''}}

					<view class="text1">
						{{list.length >2?'贡献值：'+list[2].order_amount+'':''}}
					</view>
				</view>
			</view>

		</view>
		<view class="black_2">
			<template v-for="(item,index) in list">
				<view class="item">
					<view class="line_1">
						<image class="img" :src="item.user.avatar"></image>
						<view class="text1">{{item.user.nickname}}</view>
						<view class="right">{{item.order_amount}}贡献值</view>
					</view>
					<view class="line_2">
						<!-- <image class="left" :src="'/static/economy/dengji'+item.index+'.png'"></image> -->
						<view class="middle">

							<view class="text1">+{{item.income_amount}}</view>
							<view class="text2">USDT</view>
						</view>
						<view class="right">
							<view class="text1">+{{item.speed_up_num}}</view>
							<view class="text2">加速卡</view>
						</view>
					</view>
				</view>
			</template>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					"user_id ": 3,
						"order_amount": "2176",
						"index": 1,
						"income_amount": "108.80",
						"speed_up_num": "10",
						"user": {
							"id": 3,
							"nickname": "vv给好好",
							"avatar": "/static/logo.png"
						}
				},
				
				],
			};
		},
		onShow() {
			this.list.length =0
			this.getList()
		},
		methods: {
			back() {
				uni.navigateBack()
			},
			onClickRight() {

			},
			getList() {
				this.api.http.requests('jackpotorder/lists', {}, res => {
					if (res.data && res.data.length > 0) {
						this.list = (res.data)
					}
				}, "POST")

			}
		}
	}
</script>
<style>
	page{
		background-color: #F5F5F5;
	}
</style>
<style lang="less">
	.tabs {
		width: 100%;
		height: 48px;
		z-index: 9999;
		position: fixed;
		padding-top: 25px;
		background: linear-gradient(295deg, #F28D4E 0%, #EA4123 100%);
	}

	.black_1 {
		// position: fixed;
		width: 100%;
		background: linear-gradient(295deg, #F28D4E 0%, #EA4123 100%);
		border-radius: 0px 0px 0px 0px;

		.top {
			display: flex;
			margin: 0rpx 40rpx 0rpx 40rpx;
			padding-top: 80px;
			justify-content: space-between;
			text-align: center;
			.header {
				width: 100%;
				// margin-top: 30%;
				.image {
					margin: auto;
					display: block;
					width: 70rpx;
					height: 50rpx;
					z-index: 2;
				}

				.image1 {
					margin: -20rpx auto 0rpx auto;
					display: block;
					width: 150rpx;
					height: 150rpx;
					border-radius: 100rpx;
					z-index: 1;
				}

				.uniui-image3 {}

				.image3 {
					border: 2rpx solid #ffffff;
				}


			}

			.header2 {
				width:35%;
				margin-top: 10%;
			}

			.header3 {
				width: 35%;
				margin-top: 10%;
			}
		}


		.bottom {
			width: 95%;
			display: flex;
			justify-content: space-between;
			text-align: center;
			margin: 0px 10px;
			// background: url(@/static/economy/dengji.png) no-repeat;
			background-size: 100% 100%, contain;
			height: 207rpx;
			align-items: flex-end;

			font-size: 32rpx;

			.text1 {
				font-size: 25rpx;
				font-weight: 400;
				color: #FFFFFF;
			}

			.name {
				color: #ffffff;

			}

			.name2 {
				width: 50%;
				height: 50rpx;
				text-align: center;
				padding-bottom: 45px
			}

			.name1 {
				width: 35%;
				padding-bottom: 25rpx;
			}

			.name3 {
				width: 35%;
				padding-bottom: 25rpx;
			}
		}

	}

	.black_2 {
		padding: 10px;
		background: #F5F5F5;

		.item {
			margin-top: 10px;
			background: #FFFFFF;
			border-radius: 14rpx;

			.line_1 {
				display: flex;
				justify-content: space-between;
				align-items: center;
				background: linear-gradient(295deg, #F28D4E 0%, #EA4123 100%);
				border-radius: 14px 14px 0px 0px;
				padding: 10px 10px;
				font-size: 35rpx;
				font-weight: bold;
				color: #FFFFFF;

				.img {
					width: 25px;
					height: 25px;
					border-radius: 50%;
					margin-right: 10px;
				}

				.text1 {
					flex: 1;
				}

				.right {
					margin-right: 10px;
					font-size: 28rpx;
					font-weight: bold;
					color: #FE903D;
					padding: 2px 5px;
					background: #FFFFFF;
				}
			}

			.line_2 {
				padding: 10px;
				display: flex;
				justify-content: space-between;
				text-align: center;

				.left {
					width: 50px;
					height: 60px;
				}

				.middle,
				.right {
					font-size: 53rpx;
					font-weight: 400;
					color: #FE903D;

					.text2 {
						font-size: 28rpx;
						font-weight: 400;
						color: #333333;
					}
				}
			}

		}
	}
</style>